<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"			
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

	<!-- 
		Explain: Managed Beans and EL

		* Use UserBean.java as an example.	
			
	 -->

	<h:head>
	</h:head>
	<h:body> <!-- This tag is similar to the html body tag. In a facelets page, always use h:body. (this finally gives JSF the chance to access it programmatically  -->

		<h:messages />

		<h:form>
			<h:outputLabel value="Please enter your Name:" /> <h:inputText value="#{user.name}"></h:inputText> <!-- Add the link to the user bean here -->
			<h:commandButton value="Submit" />
		</h:form>
		
		<!-- Add this: BEGIN -->
		<h:outputText value="Hello #{user.name}!" rendered="#{user.nameDefined}"/>
		<br />
		<!-- Add this: END -->
		
		<h:graphicImage value="jsf.png" width="200"></h:graphicImage>
	</h:body>

</html>